/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-1
*
\*********************************************************************/

#ifndef OPENCVFRAME_H
#define OPENCVFRAME_H

#include <opencv2/opencv.hpp>
#include <QTimer>
#include <QQuickItem>
#include <QImage>
#include <chrono>

class OpenCVFrame : public QQuickItem
{
public:
    explicit OpenCVFrame(QQuickItem *parent = 0);
    ~OpenCVFrame();

private:
    QSGNode* updatePaintNode(QSGNode * old, UpdatePaintNodeData *) override;

private:
    cv::Mat m_matFrame;
    QImage m_imgFrame;
//    bool hasAFrame = false;
//    V4L2Frame tempFrame;


//    std::chrono::system_clock::time_point nowtime = std::chrono::system_clock::now();
//    std::chrono::system_clock::time_point lastime = std::chrono::system_clock::now();

    void updateDataFrame();
};

#endif // OPENCVFRAME_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
